package com.lance.core.tool;

import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.SynthesizingMethodParameter;
import org.springframework.util.ClassUtils;

import java.lang.reflect.Method;

/**
 * @author lancecong
 * @version 1.0
 * @ClassName ClassUtil
 * @DESCRIPTION 类级别的工具类
 * @create 2019-06-28 20:31
 **/

public class ClassUtil extends ClassUtils {
    /**
     * 获取方法级别的参数信息
     * @param method
     * @param paramIndex
     * @return
     */
    public static MethodParameter getMethodParam(Method method , int paramIndex){
        MethodParameter methodParameter = new SynthesizingMethodParameter(method, paramIndex);
        methodParameter.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
        return  methodParameter;
    }


}
